home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 6 / FM Towns Free Software Collection 6.iso / ms_dos / tm / tm.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-07-08  |  2.2 KB  |  96 lines

  1. program tm;
  2. USES dos,crt,towns;
  3. type
  4.     mojiretu16=string[16];
  5. var
  6.     i,Ji,Fun,Byou,Mbyou,flag:integer;
  7.     s,End_Time:mojiretu16;
  8.     Dammy:string;
  9.     parm_date:date absolute parm_area;
  10.    
  11. function STR_T(i:integer):string;
  12. begin
  13.      str(i,Dammy);
  14.      Str_T:=Dammy;
  15. end;
  16.  
  17.  
  18. function TM_time:mojiretu16;
  19. var
  20.     s,t:mojiretu16;
  21.     parm_date:date absolute parm_area;
  22. begin
  23.      Get_date(parm_date);
  24.      s:='';
  25.      with parm_date do
  26.        begin
  27.          str(hour,t);
  28.          s:=s+t+'時';
  29.          str(minute,t);
  30.          s:=s+t+'分';
  31.          str(sec,t);
  32.          s:=s+t+'秒';
  33.      end;
  34.      TM_Time:=s;
  35. end;
  36.  
  37. begin         {メインルーチン}
  38.      
  39.      if paramcount <=0 then
  40.         begin
  41.           textcolor(aka);
  42.           writeln(^G+'パラメーターエラー');
  43.           textcolor(shiro);
  44.           writeln('使い方');
  45.           writeln('TM 時間(←半角で1~60分の間)');
  46.           halt(1);
  47.         end;
  48.  
  49.      val(paramstr(1),i,flag);
  50.      if flag<>0 then 
  51.        begin
  52.           textcolor(aka);
  53.           writeln(^G+'コマンドエラー');
  54.           textcolor(shiro);
  55.           writeln('使い方');
  56.           writeln('TM 時間(←半角で1~60分の間)');
  57.           halt(2);
  58.        end;
  59.      
  60.      Get_date(parm_date);
  61.          with parm_date do
  62.                begin
  63.                    Ji:=hour;
  64.                    Fun:=minute;
  65.                    Byou:=sec;
  66.      textcolor(mizuiro);
  67.      writeln('TM.EXE Ver.1.01α');
  68.      textcolor(midori);
  69.      writeln('Programed by H.Nakayasu, 1992.3.8 in Japan.');
  70.      textcolor(shiro);
  71.      writeln('今日は',Year,'年',Month,'月',day,'日  ',youbi,'曜日');
  72.      writeln('今の時間は',Ji,'時',Fun,'分',Byou,'秒だよ。');
  73.      Fun:=Fun+i;
  74.      if Fun>60 then
  75.          begin
  76.             fun:=Fun-60;
  77.             Ji:=Ji+1;
  78.             if Ji>24 then Ji:=Ji-24;
  79.          end;
  80.      End_Time:=Str_t(Ji)+'時'+Str_t(Fun)+'分'+Str_t(Byou)+'秒';
  81.      writeln(End_Time,'になるまで何もしないからね。');
  82.      end;
  83.     
  84.  repeat
  85.       s:=TM_time;
  86.  until (s=End_time) or keypressed;
  87.  if s=End_time 
  88.      then begin
  89.         write('時間だよ!!');
  90.         halt(3);end
  91.      else begin
  92.         write('中断したよ!!');
  93.         halt(4);
  94.      end;
  95. end.
  96.